package com.ruoyi.feedback.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.feedback.mapper.EFeedbackMapper;
import com.ruoyi.feedback.domain.EFeedback;
import com.ruoyi.feedback.service.IEFeedbackService;

/**
 * 反馈信息Service业务层处理
 *
 * @author ruoyi
 * @date 2024-11-26
 */
@Service
public class EFeedbackServiceImpl implements IEFeedbackService
{
    @Autowired
    private EFeedbackMapper eFeedbackMapper;

    /**
     * 查询反馈信息
     *
     * @param id 反馈信息主键
     * @return 反馈信息
     */
    @Override
    public EFeedback selectEFeedbackById(Integer id)
    {
        return eFeedbackMapper.selectEFeedbackById(id);
    }

    /**
     * 查询反馈信息列表
     *
     * @param eFeedback 反馈信息
     * @return 反馈信息
     */
    @Override
    public List<EFeedback> selectEFeedbackList(EFeedback eFeedback)
    {
        return eFeedbackMapper.selectEFeedbackList(eFeedback);
    }

    /**
     * 新增反馈信息
     *
     * @param eFeedback 反馈信息
     * @return 结果
     */
    @Override
    public int insertEFeedback(EFeedback eFeedback)
    {
        return eFeedbackMapper.insertEFeedback(eFeedback);
    }

    /**
     * 修改反馈信息
     *
     * @param eFeedback 反馈信息
     * @return 结果
     */
    @Override
    public int updateEFeedback(EFeedback eFeedback)
    {
        return eFeedbackMapper.updateEFeedback(eFeedback);
    }

    /**
     * 批量删除反馈信息
     *
     * @param ids 需要删除的反馈信息主键
     * @return 结果
     */
    @Override
    public int deleteEFeedbackByIds(Integer[] ids)
    {
        return eFeedbackMapper.deleteEFeedbackByIds(ids);
    }

    /**
     * 删除反馈信息信息
     *
     * @param id 反馈信息主键
     * @return 结果
     */
    @Override
    public int deleteEFeedbackById(Integer id)
    {
        return eFeedbackMapper.deleteEFeedbackById(id);
    }

    @Override
    public int updateFeedback(EFeedback eFeedback) {
        eFeedback.setReplyTime(new Date());
        eFeedback.setProcessingStatus(2);
        return eFeedbackMapper.updateEFeedback(eFeedback);
    }

    @Override
    public int updateFeedbackText(EFeedback eFeedback) {
        eFeedback.setFeedbackTime(new Date());
        eFeedback.setProcessingStatus(3);
        return  eFeedbackMapper.updateEFeedback(eFeedback);
    }
}
